import { JsonValue, extendClassProps, UniteChanged } from "xbsj-base";
import { ESObjectWithLocation } from "../base";
import { GroupProperty, StringProperty } from "@sdkSrc/ESJTypes";

export class ESStaticMesh extends ESObjectWithLocation {
    static readonly type = this.register('ESStaticMesh', this, { chsName: "静态网格", tags: ['ESObjects', '_ES_Impl_UE'], description: "Unreal的Mesh对象" })
    get typeName() { return 'ESStaticMesh'; }
    override get defaultProps() { return ESStaticMesh.createDefaultProps(); }
    static override defaults = {
        ...ESObjectWithLocation.defaults,
        mesh: "StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"
    };
    constructor(id?: string) {
        super(id);
    }

    override getESProperties() {
        const properties = { ...super.getESProperties() };
        const basic = [
            new StringProperty('mesh地址', 'mesh地址', false, false, [this, 'mesh'], ESStaticMesh.defaults.mesh)
        ];
        properties.basic.push(...basic);
        return properties;
    }

    override getProperties(language?: string) {
        return [
            ...super.getProperties(language),
            new GroupProperty('ESStaticMesh', 'ESStaticMesh', [
                new StringProperty('mesh地址', 'mesh地址', false, false, [this, 'mesh'], ESStaticMesh.defaults.mesh)
            ]),
        ]
    }
}
export namespace ESStaticMesh {
    export const createDefaultProps = () => ({
        ...ESObjectWithLocation.createDefaultProps(),
        mesh: "" as string | JsonValue, //mesh的路径
    })
}
extendClassProps(ESStaticMesh.prototype, ESStaticMesh.createDefaultProps);
export interface ESStaticMesh extends UniteChanged<ReturnType<typeof ESStaticMesh.createDefaultProps>> { };